<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                xmlns:security="http://www.springframework.org/security/tags"
                template="/templates/template.xhtml">
    <ui:define name="title">联登统计</ui:define>
    <ui:define name="content">
        <h:form>
           <p:defaultCommand target="search"/>
            <div class="topbar clearfix"
                 style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="right">
                        <p:commandButton id="search" value="查询" icon="fa fa-search"
                                         update="@form"
                                         ajax="false"
                                         rendered="#{unionLoginStatBean.isNormal()}"/>

                        <p:commandButton value="重置" icon="fa fa-refresh"
                        				 actionListener="#{unionLoginStatBean.onRest}"
                                         process="@this"
                                         update="@form"
                                         rendered="#{unionLoginStatBean.isNormal()}"/>
						 
                        
                    </f:facet>
                </p:toolbar>
            </div>
            
            <div class="ui-fluid" style="padding-top: 30px;">
                <div class="ui-g">
                    <div class="ui-g-12">
                        <div class="card">
                         <h1>查询条件</h1>
                           <p:panelGrid columns="8" layout="grid"
                                         columnClasses="ui-grid-col-1,ui-grid-col-2"
                                         styleClass="ui-panelgrid-blank"
                                         style="border:0px none; background-color:transparent;">
                                         
                               	<p:outputLabel for="startDate" value="时间"/>
                                <p:calendar id="startDate" value="#{unionLoginStatBean.$.startDate}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>-
								 <p:calendar id="endDate" value="#{unionLoginStatBean.$.endDate}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>

                                <p:outputLabel for="platform" value="平台"/>
                                <p:selectOneMenu id="platform" value="#{unionLoginStatBean.$.platform}">
                                    <f:selectItem itemLabel="全部" itemValue="" noSelectionOption="true"/>
                                   	<f:selectItem itemLabel="安卓" itemValue="android" noSelectionOption="true"/>
                                   	<f:selectItem itemLabel="ios" itemValue="ios" noSelectionOption="true"/>
                                </p:selectOneMenu>
                                
                                <p:outputLabel for="productId" value="产品"/>
                                <p:selectOneMenu id="productId" value="#{unionLoginStatBean.$.productId}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                   	 <f:selectItems
                                            value="#{unionLoginStatBean.commProductIds}"
                                            var="product"
                                            itemLabel="#{product.name}" itemValue="#{product.productId}"/>
                                </p:selectOneMenu>
                                
                                <p:outputLabel for="channelId" value="渠道"/>
                                <p:selectOneMenu id="channelId" value="#{unionLoginStatBean.$.channelId}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                   	 <f:selectItems
                                            value="#{unionLoginStatBean.commProductChannels}"
                                            var="channel"
                                            itemLabel="#{channel.channelName}" itemValue="#{channel.channelCode}"/>
                                </p:selectOneMenu>
                                
                                <p:outputLabel for="activityType" value="活动类型"/>
                                <p:selectOneMenu id="activityType" value="#{unionLoginStatBean.$.activityType}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                   	 <f:selectItems
                                            value="#{unionLoginStatBean.registerRecommendActivities}"
                                            var="recommendactivity"
                                            itemLabel="#{recommendactivity.activityTypeName}" itemValue="#{recommendactivity.activityType}"/>
                                </p:selectOneMenu>
                                
                                 <p:outputLabel for="activityId" value="活动id"/>
                                <p:selectOneMenu id="activityId" value="#{unionLoginStatBean.$.activityId}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                   	 <f:selectItems
                                            value="#{unionLoginStatBean.activityChannelConfigs}"
                                            var="atcconfig"
                                            itemLabel="#{atcconfig.remark}" itemValue="#{atcconfig.activity}"/>
                                </p:selectOneMenu>
                                
                                <p:outputLabel for="platform" value="环境"/>
                                <p:selectOneMenu id="environment" value="#{unionLoginStatBean.$.environment}">
                                    <f:selectItem itemLabel="全部" itemValue="" noSelectionOption="true"/>
                                   	<f:selectItem itemLabel="推广H5" itemValue="1" noSelectionOption="true"/>
                                   	<f:selectItem itemLabel="客户端" itemValue="2" noSelectionOption="true"/>
                                </p:selectOneMenu>
                                
                                <p:outputLabel for="page" value="页面"/>
                                 <p:inputText id="page" value="#{unionLoginStatBean.$.page}"/>
                                
                                <p:outputLabel for="ckModule" value="模块"/>
                                 <p:inputText id="ckModule" value="#{unionLoginStatBean.$.ckModule}"/>
                                 
                                 <p:outputLabel for="position" value="位置"/>
                                 <p:inputText id="position" value="#{unionLoginStatBean.$.position}"/>
                                 
                                  <p:outputLabel for="sourceId" value="活动"/>
                                <p:selectOneMenu id="sourceId" value="#{unionLoginStatBean.$.sourceId}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                   	 <f:selectItems
                                            value="#{unionLoginStatBean.unionProductInfos}"
                                            var="productInfo"
                                            itemLabel="#{productInfo.name}" itemValue="#{productInfo.id}"/>
                                </p:selectOneMenu>
                                
                                 <p:outputLabel for="loginType" value="联登类型"/>
                                <p:selectOneMenu id="loginType" value="#{unionLoginStatBean.$.loginType}">
                                    <f:selectItem itemLabel="全部" itemValue="" noSelectionOption="true"/>
                                   	<f:selectItem itemLabel="一键联登" itemValue="1" noSelectionOption="true"/>
                                   	<f:selectItem itemLabel="普通联登" itemValue="2" noSelectionOption="true"/>
                                </p:selectOneMenu>
                                
                                <p:outputLabel for="userType" value="用户类型"/>
                                <p:selectOneMenu id="userType" value="#{unionLoginStatBean.$.userType}">
                                    <f:selectItem itemLabel="全部" itemValue="" noSelectionOption="true"/>
                                   	<f:selectItem itemLabel="新用户" itemValue="1" noSelectionOption="true"/>
                                   	<f:selectItem itemLabel="老用户" itemValue="0" noSelectionOption="true"/>
                                </p:selectOneMenu>
                                
                                <p:outputLabel for="groupChannel" value="渠道分组"/>
                                <p:selectOneMenu id="groupChannel" value="#{unionLoginStatBean.$.groupChannel}">
                                   	<f:selectItem itemLabel="是" itemValue="1" noSelectionOption="true"/>
                                   	<f:selectItem itemLabel="否" itemValue="0" noSelectionOption="true"/>
                                </p:selectOneMenu>
                            </p:panelGrid>
                            
                        </div>
                        <div class="card">
                            <p:dataTable id="statBeanDataTable"
                                         style="width: 100%"
                                         var="statBean"
                                         value="#{unionLoginStatBean.lazyDataModel}"
                                         rows="#{constants:get('ROWS')}"
                                         lazy="true"
                                         paginator="true"
                                         paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                                         rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                                         emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                                         scrollable="true"
                                         scrollWidth="97%"
                                         reflow="true"
                                         resizableColumns="true">

                                <p:column headerText="时间" >
                                     <h:outputText value="#{statBean.dateTime}"/>
                                </p:column>
                                <p:column headerText="产品">
                                    <h:outputText value="#{statBean.productId}"/>
                                </p:column>
                                <p:column headerText="平台">
                                    <h:outputText value="#{statBean.platform}"/>
                                </p:column>
                                <p:column headerText="渠道">
                                    <h:outputText value="#{statBean.channelId}"/>
                                </p:column>
                                <p:column headerText="活动类型">
                                    <h:outputText value="#{statBean.activityType}"/>
                                </p:column>
                                <p:column headerText="活动id">
                                    <h:outputText value="#{statBean.newActivityId}"/>
                                </p:column>
                                <p:column headerText="环境">
                                    <h:outputText value="#{statBean.environment}"/>
                                </p:column>
                                <p:column headerText="用户">
                                    <h:outputText value="#{statBean.userType}"/>
                                </p:column>
                                  <p:column headerText="页面">
                                    <h:outputText value="#{statBean.page}"/>
                                </p:column>
                                  <p:column headerText="模块">
                                    <h:outputText value="#{statBean.ckModule}" />
                                </p:column>
                                <p:column headerText="位置">
                                    <h:outputText value="#{statBean.position}"/>
                                </p:column>
                                 <p:column headerText="活动">
                                    <h:outputText value="#{statBean.sourceId}"/>
                                </p:column>
                                 <p:column headerText="联登类型">
                                    <h:outputText value="#{statBean.loginType}"/>
                                </p:column>
                                 <p:column headerText="请求联登人数">
                                    <h:outputText value="#{statBean.loginNum}"/>
                                </p:column>
                                 <p:column headerText="联登成功人数">
                                    <h:outputText value="#{statBean.loginSuccessNum}"/>
                                </p:column>
                                 <p:column headerText="请求联登甲方数">
                                    <h:outputText value="#{statBean.jfNum}"/>
                                </p:column>
                                 <p:column headerText="联登成功甲方数">
                                    <h:outputText value="#{statBean.jfSuccessNum}"/>
                                </p:column>
                            </p:dataTable>
                        </div>
                    </div>
                </div>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
